/*! \file renamenode.h
	\author HiddenSeeker

	Defines a rename node
*/
#include "../abstractnode.h"
#include <string>
#pragma once

/*! \class RenameNode
	Declares a node with two strings to rename to
*/
class RenameNode: public AbstractNode
{
 private:
	     std::string * m_from;
		 std::string * m_to;
		 std::string * m_alias;
 public:
	     inline const std::string & from() const { return *m_from; }
		 inline const std::string & to()   const { return *m_to;   }
		 inline std::string *  alias() const { return m_alias;}
		 inline RenameNode(const YYLTYPE & pos, std::string * from, std::string * to,std::string * alias):
		        AbstractNode(pos)
		 {
			 m_from=from;
			 m_to=to;
			 m_alias=alias;
		 }
         /*! Writes a node data to stream
		 */
		 void write(GraphStream * s);

		 inline ~RenameNode()
		 {
			 if (isOwningData())
			 {
				 delete m_from;
				 delete m_to;
			 }
		 }
};